﻿<Window x:Class="OSBIDE.Controls.Views.OsbideLoginControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
             xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
             mc:Ignorable="d" Height="206" Width="380"
        Title="OSBIDE Login" ResizeMode="NoResize"
        >
    <Grid Margin="10,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition Height="28" />
            <RowDefinition Height="15" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="145*" />
            <ColumnDefinition Width="216*" />
        </Grid.ColumnDefinitions>

        <!--0,0 to 0,1 -->
        <TextBlock Grid.Row="0" Grid.Column="0" TextWrapping="Wrap" FontSize="14">Log into OSBIDE:</TextBlock>

        <!--1,0 and 1,1-->
        <TextBlock Grid.Row="1" Grid.Column="0" FontWeight="Bold" Margin="0,5,0,0">Email Address:
            <Hyperlink x:Name="ForgotEmailLink" NavigateUri="http://osbide.com/account/ForgotEmail">(Help)</Hyperlink>
        </TextBlock>
        <TextBox Grid.Row="1" Grid.Column="1" x:Name="EmailTextBox" Text="{Binding Path=Email, Mode=TwoWay}" Margin="0,5,0,0" TabIndex="0" />

        <!--2,0 and 2,1-->
        <TextBlock Grid.Row="2" Grid.Column="0" FontWeight="Bold" Margin="0,5,0,0">Password:
                <Hyperlink x:Name="ForgotPasswordLink" NavigateUri="http://osbide.com/account/ForgotPassword">(Help)</Hyperlink>
        </TextBlock>
        <PasswordBox Grid.Row="2" Grid.Column="1" x:Name="PasswordTextBox" Margin="0,5,0,0" TabIndex="1" />

        <!--3,0 -->
        <TextBlock Margin="0,0,15,0" VerticalAlignment="Bottom" Grid.Row="3">
                <Hyperlink x:Name="CreateAccountLink" Command="{Binding Path=CreateAccountCommand}">Create New Account</Hyperlink>
        </TextBlock>
        
        <!--4,0-->
        <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Bottom">
            <Hyperlink x:Name="PrivacyPolicyLink" NavigateUri="http://osbide.codeplex.com/wikipage?title=Privacy%20Policy" >
                Privacy Policy
            </Hyperlink>
        </TextBlock>
        <!--4,1-->
        <StackPanel 
            Grid.Row="4" 
            Grid.Column="1" 
            Orientation="Horizontal" 
            HorizontalAlignment="Right"
            Margin="0,5,0,0"
            >
            <wfi:WindowsFormsHost Margin="0,0,15,0" >
                <winForms:PictureBox x:Name="LoadingIcon" Visible="False" >
                </winForms:PictureBox>
            </wfi:WindowsFormsHost>
            <!--<controls:GifImage x:Name="LoadingIcon" Stretch="None" GifSource="../Images/ajax-loader.gif" Visibility="{Binding Path=LoadingIconVisible}" AutoStart="True" />-->
            <Button x:Name="LogOutButton" Width="50" Margin="0,0,7,0" Visibility="{Binding Path=IsLoggedIn}" Command="{Binding Path=LogoutCommand}" TabIndex="3">Log out</Button>
            <Button x:Name="OkayButton" Width="50" Margin="0,0,7,0" IsEnabled="{Binding Path=ButtonsEnabled}" Command="{Binding Path=LoginCommand}" TabIndex="4">Log in</Button>
            <Button x:Name="CancelButton" Width="50" IsEnabled="{Binding Path=ButtonsEnabled}" Command="{Binding Path=CancelCommand}" TabIndex="5">Cancel</Button>
        </StackPanel>

        <!-- 5,1 -->
        <TextBlock Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" FontWeight="Bold" Foreground="Red" Text="{Binding Path=ErrorText}" Margin="0,0,10,0" />
    </Grid>
</Window>
